{{>licenseInfo}}
// this model was generated using modelTest.mustache
package {{modelPackage}}
{{#imports}}import {{import}}
{{/imports}}

import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import scala.util.*

{{#models}}
{{#model}}
class {{classname}}Test extends AnyWordSpec with Matchers {

{{#operations}}
    // operation {{classname}}
    //
    {{#examples}}
    key = {{key}}
    value= {{value}}
    {{/examples}}
{{/operations}}

{{^isEnum}}
    "{{classname}}.fromJson" should {
        """not parse invalid json""" in {
           val Failure(err) = Try({{classname}}Data.fromJsonString("invalid jason"))
           err.getMessage should startWith ("Error parsing json 'invalid jason'")
        }
        """parse {{example}}""" ignore {
           val d8a = {{classname}}Data.fromJsonString("""{{example}}""")
           val Failure(err : ValidationErrors) = {{classname}}Data.validated(d8a, true)

           sys.error("TODO")
        }
    }
{{/isEnum}}
}
{{/model}}
{{/models}}
